<?php
class LoginForm extends BaseForm
{
  public function configure()
  {
    $this->setWidgets(array(
        'email'    => new sfWidgetFormInput(array()),
        'password'   => new sfWidgetFormInputPassword(array()),
        'remember'   => new sfWidgetFormInputCheckbox(array())
    ));
    
    $this->validatorSchema['email'] =  new sfValidatorEmail(array('required' => true));
    $this->validatorSchema['password'] =  new sfValidatorString(array('required' => true));
    $this->validatorSchema['remember'] =  new sfValidatorString(array('required' => false));
    $this->validatorSchema->setPostValidator(new loginValidator());

    $this->widgetSchema->setNameFormat('login[%s]');
  }
}
